package com.luqh.note.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.luqh.note.pojo.Note;
import com.luqh.note.service.NoteService;
@Controller
@RequestMapping("/")
public class NoteController {

	@Autowired
	private NoteService noteService;
	
	@RequestMapping("/index")
	public ModelAndView index() {
		ModelAndView mv = new ModelAndView();
		System.out.println("执行index()");
		List<Note> list = noteService.selectAllNote();
		mv.addObject("list", list);
		mv.setViewName("note/index");
		return mv;
	}
}
